#!/bin/bash

installDeskTool() {
    sudo apt install -y filezilla git-cola remmina vlc

    if [ ! -d /home/${user}/Downloads ]; then 
        mkdir -p /home/${user}/Downloads
    fi
    cd /home/${user}/Downloads

    # vscode
    if [ ! -f vscode.deb ]; then
        wget -P vscode.deb ${down_vscode}
    fi
    sudo dpkg -i vscode.deb

    # chrome 浏览器
    if [ ! -f google-chrome-stable_current_amd64.deb ]; then
        wget -P ./google-chrome-stable.deb ${down_chrome_browser}
    fi
    sudo dpkg -i google-chrome-stable.deb

    # Termius 一个控制台工具，类似xshell 优势就是跨平台
    if [ ! -f termius.deb ]; then
        wget -P ./termius.deb ${down_termius}
    fi
    sudo dpkg -i termius.deb

    # wps office
    if [ ! -f wps.deb ]; then
        wget -P ./wps.deb ${down_wps_office}
    fi
    sudo dpkg -i wps.deb

    # 网易云音乐
    if [ ! -f netease-cloud-music.deb ]; then
        wget -P ./netease-cloud-music.deb ${down_netease-cloud-music}
    fi
    sudo dpkg -i netease-cloud-music.deb

    # virtualbox
    if [ ! -f virtualbox.deb ]; then
        wget -P virtualbox.deb ${down_virtualbox}
    fi
    sudo dpkg -i virtualbox.deb
}

installDeskTool

#Markdown工具安装
installMarkdownTool() {
    # or run:
    # sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE
    wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -
    # add Typora's repository
    sudo add-apt-repository 'deb https://typora.io/linux ./'
    sudo apt-get update
    # install typora
    sudo apt-get install typora
}
installMarkdownTool